<!--  -->
<template>
  <div class="body">
    <div class="title">
      <van-notice-bar
        scrollable
        left-icon="volume-o"
        text="在代码阅读过程中人们说脏话的频率是衡量代码质量的唯一标准。"
      />
    </div>
  <div class="box90"></div>
    <div class="bgc">
      <van-image
        height="180"
        src="https://img01.yzcdn.cn/vant/cat.jpeg"
      ></van-image>
    </div>
    <div class="container container_margin">
      <div class="text">
        <div class="flexcol">
          <span>{{ user.number }}</span>
          <span class="brown">刷题数</span>
        </div>
        <div class="flexcol">
          <span>{{ user.right | percentFilter }}</span>
          <span class="brown">正确率</span>
        </div>
        <div class="flexcol">
          <span>{{ user.todayFinish }}</span>
          <span class="brown">今日刷题</span>
        </div>
      </div>
      <van-divider />
      <div class="yellow" @click="$router.push({ path: `/relax/` })">轻松一刻</div>
    </div>
    <div class="footer container_padding">
      <router-link to="/arena">
        <mycell title="天梯赛" class="cell">
          <van-icon name="play-circle" slot="right" color="#ccbe97" /> </mycell
      ></router-link>
      <router-link to="/history">
        <mycell title="答题记录" class="cell">
          <van-icon name="play-circle" slot="right" color="#ccbe97" /> </mycell
      ></router-link>
    </div>
  </div>
</template>

<script>
// 这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等)
import mycell from "@/components/cell.vue";

export default {
  // import引入的组件需要注入到对象中才能使用
  components: { mycell },
  data() {
    return {
      user: {
        number: 2803,
        right: 0.8,
        todayFinish: 25,
      },
    };
  },

  computed: {},

  watch: {},

  methods: {},
  mounted() {},
  filters: {
    percentFilter(num) {
      return num * 100 + "%";
    },
  },
  created: function () {
    this.$emit("tab", true);
  },
};
</script>
<style lang="less" scoped>
/* @import url(); 引入公共css类 */
.body{
  display: flex;
  align-content: flex-end;
    justify-content: space-evenly;
    flex-direction: column;
  }
.bgc {
  position: absolute;
  top: 0;
  left: 0;
}
.box90{
  height: 90px;
  }
.flexcol {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}
.brown {
  font-size: 13px;
  color: #dfdfe9;
}
.title {
  padding-top: 20px;
   z-index: 999;
}
a {
  color: #666;
}
.container {

  z-index: 9999;
 
  border-radius: 20px;
  background-color: #fff;
  padding: 50px 30px 0;
  .text {
    height: 70px;
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
  }
  .yellow {
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-size: 20px;
    color: #e7c520;
    padding-bottom: 20px;
  }
}
.footer {
  margin-top: 20px;
  .cell {
    width: 90%;
    margin: 10px auto;
    border-radius: 10px;
    font-weight: 700;
    padding-left: 20px;
  }
}
</style>